package 常用类.Array类.list.List课后练习;

public class CommodityTest {
    public static void main(String[] args) throws Exception {
        CommodityOperate commodityOperate = new CommodityOperate();
        //添加三个商品
        Commodity commodity1 = new Commodity(1, "MacBookAir", 13.3, 6988.88, 5);
        Commodity commodity2 = new Commodity(2, "ThinkpadT450", 14.0, 5999.99, 10);
        Commodity commodity3 = new Commodity(3, "ASUS-FL5800", 15.6, 4999.5, 18);
        commodityOperate.addCommodity(commodity1);
        commodityOperate.addCommodity(commodity2);
        commodityOperate.addCommodity(commodity3);
        //查看库存清单
        commodityOperate.queryAllCommodity();
        System.out.println("-------查看库存信息-------");
        Commodity commodity = commodityOperate.queryAllCommodity();
        //修改商品库存数量

        System.out.println("-------修改商品信息-------");
        //Commodity commodity4=new Commodity(4,"GeLiKongTiao",14.3,4111.2,9);
        Commodity commodity4 = new Commodity();
        commodity4.setProId(1);
        commodity4.setProName("GeLiKongTiao");
        commodity4.setProSize(14.3);
        commodity4.setProPrice(4111.2);
        commodity4.setProNum(9);
        commodityOperate.upDateCommodity(commodity4);
        commodityOperate.queryAllCommodity();
    }
}
